package com.slf.main;

import com.slf.common.LoggerUtil;
import java.util.logging.Logger;
import com.slf.common.PropsUtil;
import com.slf.common.RunJobHandler;

/**
 * @Author：时吕发
 * @Package：com.slf
 * @Project：Default (Template) Project
 * @name：${NAME}
 * @Date：2025/9/13 16:32
 * @Filename：${NAME}
 * @desc:
 */
public class OneDayTaskJob {
    private final static Logger logger = LoggerUtil.getLogger("jydatafillctp");
    public static void main(String[] args) {
        String runDate = args[0];
        if(runDate == null || runDate.isEmpty()){
            logger.severe("任务执行日期不能为空！");
            return;
        }
        String jyDataFilePath = PropsUtil.getProperty("jyDataFilePath");
        String ctpHqFilePath = PropsUtil.getProperty("ctpHqFilePath");
        String exportFilePath = PropsUtil.getProperty("exportFilePath");
        try {
            logger.info("ctpHqFilePath: " + ctpHqFilePath);
            logger.info("jyDataFilePath: " + jyDataFilePath);
            logger.info("exportFilePath: " + exportFilePath);
            logger.info("执行一次日常任务，日期：" + runDate);
            RunJobHandler.runJob(jyDataFilePath, ctpHqFilePath, exportFilePath, runDate);
        } catch (Exception e) {
            logger.severe("执行任务失败：" + e.getMessage());
            e.printStackTrace();
        }
    }
}